package com.cheer.controller;

import com.cheer.security.UserInfoHolder;
import com.cheer.service.StatisticsService;
import com.cheer.vo.Result;
import com.cheer.vo.StatisticsVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author cheer
 */
@RestController
@RequestMapping("/statistics")
public class StatisticsController {

    @Autowired
    private UserInfoHolder userInfoHolder;

    @Autowired
    private StatisticsService statisticsService;

    /**
     * 查询数据统计
     */
    @GetMapping
    public Result<StatisticsVO> getStatistics() {
        StatisticsVO statisticsVO = statisticsService.getStatistics(userInfoHolder.getAdminOrgId());
        return Result.success(statisticsVO);
    }
}
